<template>
  <div class="index">
    <div class="indexT ac">
      <p>
        <img src="../assets/search.png" />
      </p>
      <p>
        <span>推荐</span>
        <span>
          <img src="../assets/shu.png" />
        </span>
        <span>附近</span>
      </p>
      <p>
        <img src="../assets/sfx.png" />
      </p>
    </div>
    <div class="indexInfo wn">
      <div v-for="(list,index) in workData" :key="index" class="recruit flex" @click="workDetail(list.id)">
        <div class="recruitInfo">
          <p>
            <img src="../assets/logo.png" />
          </p>
          <p class="col">
            <span>{{list.title}}</span>
            <span class>
              <img src="../assets/dw.png" />{{list.address}}
            </span>
            <span class="ac">
              <img src="../assets/jx.png" />{{list.status_link}}
            </span>
          </p>
          <p>{{list.created_at}}</p>
        </div>
        <div class="recruitImg bt">
          <img v-for="(item,index1) in list.images" :key="index1+10" :src="'http://sza.hzlyzhenzhi.com/' + item" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      workData: [],
      advertisementData: [] // 广告
    }
  },
  created() {
    this.$parent.showTabbar = true;
    this.workList()
    this.advertisement()
  },
  methods: {
    advertisement() {
      this.$axios({
        url: 'decoration/advertisement',
        method: 'get'
      }).then(res => {
        if (res.data.code === 200) {
          this.advertisementData = res.data.data
        }
      })
    },
    workDetail(id) {
      this.$router.push({
        path: '/snatchBills',
        query: {
          id: id
        }
      })
    },
   workList() {
     this.$axios({
       url: 'decoration/release',
       method: 'get'
     }).then(res => {
       if (res.data.code === 200) {
         this.workData = res.data.data
       }
     })
   }
  },
};
</script>

<style lang="less">
.indexT {
  padding: 10px 0;
  background: linear-gradient(0deg, #e91a0e 0%, #f54822 100%),
    linear-gradient(0deg, #e40805 0%, #e40a07 100%);
  p {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f5efef;
  }
  p:nth-child(1),
  p:nth-child(3) {
    width: 10%;
    img {
      width: 47%;
    }
  }
  p:nth-child(2) {
    width: 80%;
    span {
      display: flex;
      align-items: center;
      font-size: 16px;
    }
    span:nth-child(2) {
      padding: 0 10px;
      img {
        width: 65%;
      }
    }
  }
}
.indexInfo {
  padding: 10px 0 60px 0;
}
.recruit {
  padding: 10px 8px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 2px 2px 1px #ccc;
  margin-bottom: 10px;
}
.recruitInfo {
  display: flex;
  width: 100%;
  p {
    display: flex;
  }

  p:first-child {
    width: 24%;
    border-radius: 100%;
    img {
      border-radius: 100%;
      width: 5.4rem;
      height: 5.4rem;
    }
  }
  p:nth-child(2) {
    width: 56%;
    padding-left: 5px;
    //  !important;
    span:nth-child(2) {
      img {
        width: 1rem;
        height: 1.2rem;
      }
    }
    span:nth-child(3) {
      img {
        width: 1rem;
        height: 1rem;
      }
    }
    img:first-child {
      width: 1rem;
      height: 1.2rem;
    }
    span {
      font-size: 12px;
      padding-top: 3px;
    }
    span:first-child {
      color: #363636;
      font-size: 18px;
      font-weight: 550;
    }
  }
  p:last-child {
    width: 200px;
    font-size: 12px;
    color: #a7a2a2;
    padding-top: 5px;
  }
}
.recruitImg {
  width: 100%;
  padding-top: 10px;
  img {
    width: 32%;
    height: 5.9rem;
  }
}
</style>